package com.itheima.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.domain.db.Announcement;
import com.itheima.domain.vo.PageResult;
import com.itheima.dubbo.mapper.AnnouncementMapper;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author 阿鹏
 * @date 2021/2/4 15:47
 */
@Service
public class AnnouncementApiImpl implements AnnouncementApi {

    @Autowired
    private AnnouncementMapper mapper;

    @Override
    public IPage<Announcement> findAnnouncementList(int page, int pagesize) {
        IPage<Announcement> iPage = mapper.selectPage(new Page<>(page, pagesize), new QueryWrapper<>());

        return iPage;
    }
}
